package day19;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;

/**
 * 自定义一个行号缓冲流对象，获取行号
 * 
 * @author wangbiao
 * 
 */
public class CustomLineNumberReader extends BufferedReader {

	private int lineNumber = 0;
	
	public CustomLineNumberReader(Reader in) {
		super(in);
	}

	public CustomLineNumberReader(Reader in, int sz) {
		super(in, sz);
	}

	public int getLineNumber() {
		return lineNumber;
	}

	public void setLineNumber(int lineNumber) {
		this.lineNumber = lineNumber;
	}

	@Override
	public String readLine() throws IOException {
		this.lineNumber ++;
		return super.readLine();
	}
	
	
	

}
